﻿/*
 * shaim
 * http://shaim.net
 * Copyright ©2005-2008, shaim dev team
 * Licensed under the Massachusetts Institute of Technology (MIT) License
 * http://www.opensource.org/licenses/mit-license.php
 * 
 */

using LibGreen;
namespace csammisrun.shaim
{
    /// <summary>
    /// Defines a chat room, a conversation which can have more than two participants
    /// </summary>
    public class ChatRoom : MetaContact
    {
        private IProtocolPlugin _protocol;
        private bool _suppressroomlist;
        private object _rawchat;

        /// <summary>
        /// Initializes a new ChatRoom
        /// </summary>
        public ChatRoom(string roomname, IProtocolPlugin creator, object rawchat) : base(null)
        {
            DisplayName = roomname;
            _protocol = creator;
            _rawchat = rawchat;
        }

        #region Properties
        /// <summary>
        /// Overriden - chat rooms are neither online nor offline
        /// </summary>
        public override ContactStatus Status
        {
            get
            {
                return ContactStatus.ChatRoom;
            }
        }

        /// <summary>
        /// Overriden - chat rooms are always collapsed
        /// </summary>
        public override bool Collapsed
        {
            get
            {
                return true;
            }
        }

        /// <summary>
        /// The IProtocolPlugin associated with this chat room
        /// </summary>
        public IProtocolPlugin Protocol
        {
            get { return _protocol; }
            set { _protocol = value; }
        }

        /// <summary>
        /// The raw contact object received by the protocol plugin
        /// </summary>
        public object RawChat
        {
            get { return _rawchat; }
            set { _rawchat = value; }
        }

        /// <summary>
        /// Gets or sets a value indicating whether the room's occupant list should be suppressed by the UI
        /// </summary>
        public bool SuppressRoomList
        {
            get { return _suppressroomlist; }
            set { _suppressroomlist = value; }
        }
        #endregion
    }
}
